Skip to main content

Azure Integration Guide

This guide outlines the steps to integrate Azure Pipelines into your development workflow. Azure Pipelines is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate building, testing, and deploying your code.

Prerequisites

  • An Azure DevOps account.
  • The following tools installed on your Jenkins server:
    • jq: A lightweight and flexible command-line JSON processor. You can install it by following the instructions at jq installation guide.
    • curl: A command-line tool to transfer data to or from a server using various protocols. You can install it by following the instructions at curl download page.

Steps

Step 1: Setting Up a New Pipeline

  1. Open the Azure Devops Pipelines section.
  2. Click on New Pipeline.
  3. Click on Use the classic editor to create a pipeline without YAML.
  4. Select Azure Repos Git from the source options.
  5. Configure the project, repository, and branch.
  6. Start with an empty job template on template selection page.

Step 2: Configuring Pipeline Options

  1. Configure the agent pool and agent specification with available agent within agent job section.
  2. Create a pipeline variable named API_KEY with the following value:
    sample_api_integration_key

Step 3: Handling the Execution Script

  1. Download the execute.sh file and place it in the repository.

  2. Replace the placeholder text PLACE_YOUR_CURL_COMMAND_HERE on line 71 of execute.sh with the following:

    curl --location false/v2/apikeyexecution/runCollection \
      --header "Content-Type: application/json" \
      --header "api-key: your_sample_api_key_here" \
      --data '{
        "projectId": "project_sample_id",
        "organizationId": "org_sample_id",
        "collectionIds": [
          {
            "collectionId": "coll_sample_collection_id",
            "reqIds": [
              "req_sample_id_1",
              "req_sample_id_2",
              "req_sample_id_3"
            ]
          }
        ],
        "config": {
          "environmentId": "env_sample_env_id",
          "delay": 0,
          "totalIterations": 1,
          "testDataSetId": "tdt_sample_test_data_id"
        }
      }'

    in execute.sh file on line no. 71.

  3. Add a task named Bash from the Add Task(+) menu.

  4. Configure the Bash task with the type set to File Path.

  5. In the Script Path field, add the location of the execute.sh file, and add the argument -t ${API_KEY}.

  6. Add another task named Publish Test Results from the Add Task(+) menu.

  7. Select the test result format as JUnit and set the test results file to result.xml.

Step 4: Finalizing Configuration

  1. Save the pipeline configuration.
  2. Click on Run pipeline to initiate the build process and publish the test results.